package com.company.project.service.ldjsc.weather.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.company.project.entity.ldjsc.weather.ZyCityCodeEntity;
import com.company.project.mapper.ldjsc.weather.ZyCityCodeMapper;
import com.company.project.service.ldjsc.weather.ZyCityCodeService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;



@Service("zyCityCodeService")
public class ZyCityCodeServiceImpl extends ServiceImpl<ZyCityCodeMapper, ZyCityCodeEntity> implements ZyCityCodeService {


    /**
     * 根据城市名称查询城市编码
     * @param city
     * @return
     */
    @Override
    public ZyCityCodeEntity selectNameByCode(String city) {
        LambdaQueryWrapper<ZyCityCodeEntity> queryWrapper = Wrappers.lambdaQuery();
        //查询条件示例
        queryWrapper.like(ZyCityCodeEntity::getCityName, city);
        return this.getOne(queryWrapper);
    }
}
